<%@page import="cn.edu.pku.wxlib.booksku.model.*"%>

<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib tagdir="/WEB-INF/tags/simpletable" prefix="simpletable"%>
<%@ include file="/commons/taglibs.jsp"%>

<rapid:override name="head">
	<title>Booksku</title>

	<script src="${ctx}/scripts/rest.js"></script>
	<link href="<c:url value="/widgets/simpletable/simpletable.css"/>"
		type="text/css" rel="stylesheet">
	<script type="text/javascript"
		src="<c:url value="/widgets/simpletable/simpletable.js"/>"></script>

	<script type="text/javascript">
		$(document).ready(function() {
			window.simpleTable = new SimpleTable('queryForm',${page.thisPageNumber},${page.pageSize},'${pageRequest.sortColumns}');
		});
	</script>
</rapid:override>

<rapid:override name="content">
	<form action="${ctx}/booksku/search" id="queryForm" name="queryForm"
		method="get" style="display: inline;">
		<div class="search">
			<div class="form-group inline icon">
				<i class="icon-list"></i> <input placeholder="请输入图书名称"
					value="${query.bookId}" id="bookId" name="bookId" maxlength="10"
					class="form-field" />
			</div>
			<div class="form-group inline icon">
				<i class="icon-list"></i> <input placeholder="请输入书架"
					value="${query.shelfId}" id="shelfId" name="shelfId" maxlength="10"
					class="form-field" />
			</div>
			<%-- <div class="form-group inline icon">
				<i class="icon-list"></i> <input
					placeholder="请输入1非外借，2在架，3在借，4已预约，5下架，6报废，7丢失"
					value="${query.state}" id="state" name="state" maxlength="10"
					class="form-field" />
			</div> --%>
			<div class="form-group inline icon">
				<i class="icon-list"></i> <input placeholder="请输入图书借阅类型"
					value="${query.bookBorrowTypeId}" id="bookBorrowTypeId"
					name="bookBorrowTypeId" maxlength="10" class="form-field" />
			</div>
			<%-- <div class="form-group inline icon">
				<i class="icon-list"></i> <input placeholder="请输入预留条形码"
					value="${query.barCode}" id="barCode" name="barCode" maxlength="13"
					class="form-field" />
			</div> --%>
			<%-- <input style="display: none" type="text" name=bookId
				value="${query.bookId}"> <input type="submit" value="查询"> --%>
			<div class="form-group inline icon search-btn"
				onclick="$('#queryForm').submit();" title="查询">
				<i class="icon-search"></i>
			</div>
		</div>
	</form>

	<div class="handleControl">
		<button type="button" class="btn btn-primary"
			onclick="window.location = '${ctx}/booksku/new'">新增</button>
		<button type="button" class="btn btn-default"
			onclick="doRestBatchDelete('${ctx}/booksku','items',document.forms.queryForm)">删除</button>
	</div>

	<div class="gridTable">
		<table width="100%" border="0" cellspacing="0"
			class="table text-center">
			<thead>
				<tr>
					<th style="width: 1px;"><input type="checkbox"
						onclick="setAllCheckboxState('items',this.checked)"></th>
					<th sortColumn="bookId">图书编号</th>
					<th sortColumn="shelfId">书架</th>
					<th sortColumn="state">状态</th>
					<th sortColumn="bookBorrowTypeId">图书借阅类型</th>
					<!-- <th sortColumn="barCode">预留条形码</th> -->
					<th sortColumn="createTime">创建时间</th>
					<th style="white-space: nowrap;">操作</th>
				</tr>
			</thead>
			<tbody>
				<c:forEach items="${bookskuList}" var="item" varStatus="status">
					<tr>
						<td><input type="checkbox" name="items"
							value="${item.bookSkuid}"></td>
						<td><c:out value='${item.bookId}' />&nbsp;</td>
						<td><c:out value='${item.shelfId}' />&nbsp;</td>
						<td><c:out value='${item.state}' />&nbsp;</td>
						<td><c:out value='${item.bookBorrowTypeId}' />&nbsp;</td>
						<%-- <td><c:out value='${item.barCode}' />&nbsp;</td> --%>
						<td><c:out value='${item.createTimeString}' />&nbsp;</td>
						<td><a href="${ctx}/booksku/${item.bookSkuid}"
							class="operation">查看</a>&nbsp;&nbsp; <a
							href="${ctx}/booksku/${item.bookSkuid}/edit" class="operation">修改</a>&nbsp;&nbsp;
							<a href="${ctx}/booksku/${item.bookSkuid}"
							onclick="doRestDelete(this,'你确认删除?');return false;"
							class="operation">删除</a></td>
					</tr>

				</c:forEach>
			</tbody>
		</table>

		<simpletable:pageToolbar page="${page}">
		</simpletable:pageToolbar>

	</div>
</rapid:override>
<rapid:override name="script">
	<script></script>
</rapid:override>
<%@ include file="base.jsp"%>
